package org.csu.gp_store.common;


import lombok.Getter;

@Getter
public enum OrderStatusCode {
        WAIT_PAID(0,"待支付"),
        WAIT_ACCEPT(1,"待接受"),
        WAIT_SENT(2,"代发货"),
        WAIT_RECEIVED(3,"代收货"),
        WAIT_COMMENT(4,"代评价"),
        SUCCESS(5,"已完成"),
        DENIED(7,"订单已被拒绝");


    private final int code;

    private final String description;

    OrderStatusCode(int code, String description) {
        this.code = code;
        this.description = description;
    }
    public static String getDescriptionByCode(int code){
        switch (code){
            case 0:return WAIT_PAID.getDescription();
            case 1:return WAIT_ACCEPT.getDescription();
            case 2:return WAIT_SENT.getDescription();
            case 3:return WAIT_RECEIVED.getDescription();
            case 4:return WAIT_COMMENT.getDescription();
            case 5:return SUCCESS.getDescription();
            case 7:return DENIED.getDescription();
            default:return "未知状态";
        }
    }
}
